3.1043 \(\int (g \cos (e+f x))^p (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx\)

Optimal. Leaf size=149 \[ -\frac{a^2 2^{\frac{p}{2}+\frac{5}{2}} (\sin (e+f x)+1)^{\frac{1}{2} (-p-5)+2} (g \cos (e+f x))^{p+1} (c+d \sin (e+f x))^n \left (\frac{c+d \sin (e+f x)}{c+d}\right )^{-n} F_1\left (\frac{p+1}{2};\frac{1}{2} (-p-3),-n;\frac{p+3}{2};\frac{1}{2} (1-\sin (e+f x)),\frac{d (1-\sin (e+f x))}{c+d}\right )}{f g (p+1)} \]

[Out]

-((2^(5/2 + p/2)*a^2*AppellF1[(1 + p)/2, (-3 - p)/2, -n, (3 + p)/2, (1 - Sin[e + f*x])/2, (d*(1 - Sin[e + f*x]
))/(c + d)]*(g*Cos[e + f*x])^(1 + p)*(1 + Sin[e + f*x])^(2 + (-5 - p)/2)*(c + d*Sin[e + f*x])^n)/(f*g*(1 + p)*
((c + d*Sin[e + f*x])/(c + d))^n))

________________________________________________________________________________________

Rubi [A]  time = 0.222132, antiderivative size = 153, normalized size of antiderivative = 1.03, number of steps used = 3, number of rules used = 3, integrand size = 35, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.086, Rules used = {2920, 139, 138} \[ -\frac{a^2 g 2^{\frac{p+5}{2}} (1-\sin (e+f x)) (\sin (e+f x)+1)^{\frac{1-p}{2}} (g \cos (e+f x))^{p-1} (c+d \sin (e+f x))^n \left (\frac{c+d \sin (e+f x)}{c+d}\right )^{-n} F_1\left (\frac{p+1}{2};\frac{1}{2} (-p-3),-n;\frac{p+3}{2};\frac{1}{2} (1-\sin (e+f x)),\frac{d (1-\sin (e+f x))}{c+d}\right )}{f (p+1)} \]

Antiderivative was successfully verified.

[In]

Int[(g*Cos[e + f*x])^p*(a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^n,x]

[Out]

-((2^((5 + p)/2)*a^2*g*AppellF1[(1 + p)/2, (-3 - p)/2, -n, (3 + p)/2, (1 - Sin[e + f*x])/2, (d*(1 - Sin[e + f*
x]))/(c + d)]*(g*Cos[e + f*x])^(-1 + p)*(1 - Sin[e + f*x])*(1 + Sin[e + f*x])^((1 - p)/2)*(c + d*Sin[e + f*x])
^n)/(f*(1 + p)*((c + d*Sin[e + f*x])/(c + d))^n))

Rule 2920

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) +
 (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(a^m*g*(g*Cos[e + f*x])^(p - 1))/(f*(1 + Sin[e + f*x])^((p - 1)/2)*(1 -
Sin[e + f*x])^((p - 1)/2)), Subst[Int[(1 + (b*x)/a)^(m + (p - 1)/2)*(1 - (b*x)/a)^((p - 1)/2)*(c + d*x)^n, x],
 x, Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m]

Rule 139

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Dist[(e + f*x)^
FracPart[p]/((b/(b*e - a*f))^IntPart[p]*((b*(e + f*x))/(b*e - a*f))^FracPart[p]), Int[(a + b*x)^m*(c + d*x)^n*
((b*e)/(b*e - a*f) + (b*f*x)/(b*e - a*f))^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] &&  !IntegerQ[m]
&&  !IntegerQ[n] &&  !IntegerQ[p] && GtQ[b/(b*c - a*d), 0] &&  !GtQ[b/(b*e - a*f), 0]

Rule 138

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[((a + b*x)
^(m + 1)*AppellF1[m + 1, -n, -p, m + 2, -((d*(a + b*x))/(b*c - a*d)), -((f*(a + b*x))/(b*e - a*f))])/(b*(m + 1
)*(b/(b*c - a*d))^n*(b/(b*e - a*f))^p), x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] &&  !IntegerQ[m] &&  !Inte
gerQ[n] &&  !IntegerQ[p] && GtQ[b/(b*c - a*d), 0] && GtQ[b/(b*e - a*f), 0] &&  !(GtQ[d/(d*a - c*b), 0] && GtQ[
d/(d*e - c*f), 0] && SimplerQ[c + d*x, a + b*x]) &&  !(GtQ[f/(f*a - e*b), 0] && GtQ[f/(f*c - e*d), 0] && Simpl
erQ[e + f*x, a + b*x])

Rubi steps

\begin{align*} \int (g \cos (e+f x))^p (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx &=\frac{\left (a^2 g (g \cos (e+f x))^{-1+p} (1-\sin (e+f x))^{\frac{1-p}{2}} (1+\sin (e+f x))^{\frac{1-p}{2}}\right ) \operatorname{Subst}\left (\int (1-x)^{\frac{1}{2} (-1+p)} (1+x)^{2+\frac{1}{2} (-1+p)} (c+d x)^n \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{\left (a^2 g (g \cos (e+f x))^{-1+p} (1-\sin (e+f x))^{\frac{1-p}{2}} (1+\sin (e+f x))^{\frac{1-p}{2}} (c+d \sin (e+f x))^n \left (-\frac{c+d \sin (e+f x)}{-c-d}\right )^{-n}\right ) \operatorname{Subst}\left (\int (1-x)^{\frac{1}{2} (-1+p)} (1+x)^{2+\frac{1}{2} (-1+p)} \left (-\frac{c}{-c-d}-\frac{d x}{-c-d}\right )^n \, dx,x,\sin (e+f x)\right )}{f}\\ &=-\frac{2^{\frac{5+p}{2}} a^2 g F_1\left (\frac{1+p}{2};\frac{1}{2} (-3-p),-n;\frac{3+p}{2};\frac{1}{2} (1-\sin (e+f x)),\frac{d (1-\sin (e+f x))}{c+d}\right ) (g \cos (e+f x))^{-1+p} (1-\sin (e+f x)) (1+\sin (e+f x))^{\frac{1-p}{2}} (c+d \sin (e+f x))^n \left (\frac{c+d \sin (e+f x)}{c+d}\right )^{-n}}{f (1+p)}\\ \end{align*}

Mathematica [F]  time = 19.8071, size = 0, normalized size = 0. \[ \int (g \cos (e+f x))^p (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^n \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(g*Cos[e + f*x])^p*(a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^n,x]

[Out]

Integrate[(g*Cos[e + f*x])^p*(a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^n, x]

________________________________________________________________________________________

Maple [F]  time = 0.616, size = 0, normalized size = 0. \begin{align*} \int \left ( g\cos \left ( fx+e \right ) \right ) ^{p} \left ( a+a\sin \left ( fx+e \right ) \right ) ^{2} \left ( c+d\sin \left ( fx+e \right ) \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^n,x)

[Out]

int((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^n,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \sin \left (f x + e\right ) + a\right )}^{2} \left (g \cos \left (f x + e\right )\right )^{p}{\left (d \sin \left (f x + e\right ) + c\right )}^{n}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^n,x, algorithm="maxima")

[Out]

integrate((a*sin(f*x + e) + a)^2*(g*cos(f*x + e))^p*(d*sin(f*x + e) + c)^n, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (-{\left (a^{2} \cos \left (f x + e\right )^{2} - 2 \, a^{2} \sin \left (f x + e\right ) - 2 \, a^{2}\right )} \left (g \cos \left (f x + e\right )\right )^{p}{\left (d \sin \left (f x + e\right ) + c\right )}^{n}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^n,x, algorithm="fricas")

[Out]

integral(-(a^2*cos(f*x + e)^2 - 2*a^2*sin(f*x + e) - 2*a^2)*(g*cos(f*x + e))^p*(d*sin(f*x + e) + c)^n, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))**p*(a+a*sin(f*x+e))**2*(c+d*sin(f*x+e))**n,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*cos(f*x+e))^p*(a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^n,x, algorithm="giac")

[Out]

Exception raised: AttributeError